﻿<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
 <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>


<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title> - 数据表格</title>
    <meta name="keywords" content="">
    <meta name="description" content="">

    <link rel="shortcut icon" href="${pageContext.request.contextPath }/shoppingadmin/favicon.ico"> 
    <link href="${pageContext.request.contextPath }/shoppingadmin/css/bootstrap.min.css?v=3.3.6" rel="stylesheet">
    <link href="${pageContext.request.contextPath }/shoppingadmin/css/font-awesome.css?v=4.4.0" rel="stylesheet">
    <!-- Data Tables -->
    <link href="${pageContext.request.contextPath }/shoppingadmin/css/dataTables.bootstrap.css" rel="stylesheet">
    <!-- Sweet Alert -->
    <link href="${pageContext.request.contextPath }/shoppingadmin/css/sweetalert.css" rel="stylesheet">
    <link href="${pageContext.request.contextPath }/shoppingadmin/css/animate.css" rel="stylesheet">
    <link href="${pageContext.request.contextPath }/shoppingadmin/css/style.css?v=4.1.0" rel="stylesheet">
</head>
<body class="gray-bg">
    <div class="wrapper wrapper-content animated fadeInRight">
        <div class="row">
            <div class="col-sm-12">
                <div class="ibox float-e-margins">
                    <div class="ibox-title">
                        <h5>管理员列表</h5>
                        <div class="ibox-tools">
                        </div>
                    </div>
                    <div class="ibox-content">
                        <table class="table table-striped table-bordered table-hover dataTables-example">
                            <thead>
                                <tr>
                                	<th>登录名</th>
                                    <th>权限</th>
                                    <th>操作</th>
                                </tr>
                            </thead>
                           		 <tbody>
                           <c:forEach var="list" items="${adminuser }">
                                <tr class="gradeX">
                                	<input id="${list.id}" type="hidden" value="${list.id}" />
                                    <td>${list.roleName }</td>
                                    <td>
                                    ${list.types.ty_name }
                                    </td>
                                    <td class="center" style="padding: 6px;">
	                                    <a href="${pageContext.request.contextPath }/login/getadminbyid.html/${list.id}">
	                                    <button class="btn  btn-info" style="margin-bottom: 0px;padding: 0px 5px;">修改</button>
	                                    </a>
	                                    <input type="hidden" value="${list.id}"/>
	                                  	  <button  class="btn btn-info delete" style="margin-bottom: 0px;padding: 0px 5px;">删除</button>
                                    </td>
                                </tr> 
                                
                           </c:forEach>
                            </tbody>
                           
                        </table>
                      <!--   <div class="row">
                        	<div class="col-sm-6">
                        		<div class="dataTables_info" id="DataTables_Table_0_info" role="alert" aria-live="polite" aria-relevant="all">
                        		显示 1 到 1 项，共 1 项</div>
                        		</div>
                        	<div class="col-sm-6">
                        		<div class="dataTables_paginate paging_simple_numbers" id="DataTables_Table_0_paginate">
                        			<ul class="pagination">
                        				<li class="paginate_button previous" aria-controls="DataTables_Table_0" tabindex="0" id="DataTables_Table_0_previous">
                        					<a href="#">上一页</a>
                        				</li>
                        				<li class="paginate_button active" aria-controls="DataTables_Table_0" tabindex="0">
                        					<a href="#">1</a>
                        				</li>
                        				<li class="paginate_button next" aria-controls="DataTables_Table_0" tabindex="0" id="DataTables_Table_0_next">
                        					<a href="#">下一页</a>
                        				</li>
                        			</ul>
                        		</div>
                        	</div>
                        </div> -->
                    </div>
                </div>
            </div>
        </div>
    </div>

    <!-- 全局js -->
    <script src="${pageContext.request.contextPath }/shoppingadmin/js/jquery.min.js?v=2.1.4"></script>
    <script src="${pageContext.request.contextPath }/shoppingadmin/js/bootstrap.min.js?v=3.3.6"></script>
    <script src="${pageContext.request.contextPath }/shoppingadmin/js/jquery.jeditable.js"></script>
    <!-- Data Tables -->
    <script src="${pageContext.request.contextPath }/shoppingadmin/js/jquery.dataTables.js"></script>
    <script src="${pageContext.request.contextPath }/shoppingadmin/js/dataTables.bootstrap.js"></script>
    <!-- 自定义js -->
    <script src="${pageContext.request.contextPath }/shoppingadmin/js/content.js?v=1.0.0"></script>
    <!-- Page-Level Scripts -->
    
    <!-- Sweet alert -->
    <script src="${pageContext.request.contextPath }/shoppingadmin/js/sweetalert.min.js"></script>
    <script>
        $(document).ready(function () {
        	$(".delete").click(function () {
        		var id=$(this).prev().val();
        		if(confirm("确定删除吗？删除后将无法恢复！")){
        			window.location.href="${pageContext.request.contextPath }/login/deladminofid.html?ids="+id;
        			return true;
        		}else{
        			return false;
        		}
            });
        	
            $('.dataTables-example').dataTable();
            /* Init DataTables */
            var oTable = $('#editable').dataTable();

            /* Apply the jEditable handlers to the table */
            oTable.$('td').editable('../example_ajax.php', {
                "callback": function (sValue, y) {
                    var aPos = oTable.fnGetPosition(this);
                    oTable.fnUpdate(sValue, aPos[0], aPos[1]);
                },
                "submitdata": function (value, settings) {
                    return {
                        "row_id": this.parentNode.getAttribute('id'),
                        "column": oTable.fnGetPosition(this)[2]
                    };
                },

                "width": "90%",
                "height": "100%"
            });


        });

        function fnClickAddRow() {
            $('#editable').dataTable().fnAddData([
                "Custom row",
                "New row",
                "New row",
                "New row",
                "New row"]);

        }
    </script>
</body>
</html>